import time

from selenium import webdriver
from selenium.webdriver.common.by import By

# start the session
driver = webdriver.Edge()

# navigate to the website
driver.get("https://www.selenium.dev/selenium/web/web-form.html")

# request information
title = driver.title
assert title == "Web form"

# wait
driver.implicitly_wait(0.5)
time.sleep(11)

# find the elements
text_box = driver.find_element(by=By.NAME, value="my-text")
submit_button = driver.find_element(by=By.CSS_SELECTOR, value="button")

# actions on the elements
text_box.send_keys("Selenium")
submit_button.click()

# request element information
message = driver.find_element(by=By.ID, value="message")
value = message.text
assert value == "Received!"

# end the session
time.sleep(11)
driver.quit()
